<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('项目管理')"/>
    <th:block th:include="include :: select2-css"/>
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="col-sm-12 search-collapse">
        <form id="role-form">
            <div class="select-list">
                <ul>
                    <li>
                        项目名称：<input type="text" name="name"/>
                    </li>
                    <li>
                        <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                        <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                    </li>
                </ul>
            </div>
        </form>
    </div>
    <div class="row">
        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer"/>
<th:block th:include="include :: select2-js"/>
<script th:inline="javascript">
    // 权限

    // 字典
    var prefix = ctx + "business/integration";

    $(function () {
        var options = {
            url: prefix + "/list",
            updateUrl: prefix + "/edit/{id}",
            modalName: "数据",
            columns: [
                {
                    field: 'name',
                    title: '项目名称',
                },
                {
                    field: 'phone',
                    title: '操作方式',
                },
                {
                    field: 'age',
                    title: '年龄',
                },
                {
                    field: 'grade',
                    title: '年级',
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function (value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs " href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-success btn-xs " href="javascript:void(0)" onclick="viewTrainAmount(\'' + row.code + '\')"><i class="fa fa-edit"></i>查看训练量</a> ');
                        return actions.join('');
                    }
                }]
        };
        $.table.init(options);
    });


    function viewTrainAmount(projectCode) {
        var url = ctx + "business/integrationTrainAmount/list/" + projectCode;
        $.modal.openTab("项目训练量", url);
    }
</script>
</body>

</html>